<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%;">
   <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
   <head>
      <title>
         {{site_name}}
      </title>
      <link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.min.css" type="text/css" media="screen" />
      <link rel="stylesheet" href="{{ STATIC_URL }}css/project_layout/layout.css" type="text/css" media="screen" />
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
      <script type="text/javascript" src="{{ STATIC_URL }}js/livevalidation_standalone.compressed.js"></script>
      <script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
      <script type="text/javascript" src="{{ STATIC_URL }}js/SVN/AJAXFileLoader.js"></script>
      <script type="text/javascript" src="{{ STATIC_URL }}js/livevalidation.js"></script>
   </head>
   <body style="background-color: #F2F2F2; height:100%">
      <div id="wrapper" style="min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -20px;">
      {% if user.is_authenticated %}
        {% include "svn/chat/window.html"%}
         <button class="btn btn-primary" type="button" onclick="$('#chat').toggle();$('#chatnotification').attr('class', 'btn btn-primary'); $('#chatnotification').html('Chat Lobby');"style="position:fixed; bottom:0; right:0; width: 200px"id="chatnotification">Chat Lobby</button>
      {% endif %}

         <div id="header">
         </div>
         <div id="content">
            <!-- <body style="background-color: #F2F2F2"> -->
               <!-- Start of navigation bar -->
               <div class="navbar navbar-fixed-top">
                  <div class="navbar-inner">
                     <a class="brand">&nbsp&nbsp{{site_name}}</a>
                     <ul class="nav">
                        {% if user.is_authenticated %}
                        <li id="loginhandler"><a><i class="icon-user"></i>{{ user.username }}</a></li>
                        <li><a href="/admin"><i class="icon-pencil"></i>Admin</a></li>
                        {% else %}
                        <li id="loginhandler"><a><i class="icon-play"></i>Login</a></li>
                        {% endif %}
                        <li><a href="/svn/"><i class="icon-folder-close"></i>Repositories</a></li>
                        {% for key,value in rtval.0.path.items %}
                        {% if key == "" %}
                        <li><a href="/svn/?repo={{ value }}&amp;&amp;name={{ key }}&amp;&amp;id={{ rtval.0.id }}"><i class="icon-folder-open"></i>{{ repo_label }}</a></li>
                        {% else %}
                        <li><a href="/svn/?repo={{ value }}&amp;&amp;name={{ key }}&amp;&amp;id={{ rtval.0.id }}"><i class="icon-folder-open"></i>{{ key }}</a></li>
                        {% endif %}
                        {% endfor %}
                     </ul>
                  </div>
               </div>
               <!-- End of navigation bar -->
               <div style="min-height: 45px"></div>
               <div>
                  <div id="loginpanel" style="position: fixed; padding: 10px; float: right; display:none; background-color: black; opacity: 0.4; color:white; z-index: 100">
                     {% if user.is_authenticated %}
                     {% include "svn/login/member.html" %}
                     {% else %}
                     {% include "svn/login/login.html" %}
                     {% endif %}
                  </div>
                  {% if not user.is_authenticated %}
                  <div id="registerpanel" style="position: fixed; padding: 10px; float: right; display:none; background-color: black; opacity: 0.4; color:white; z-index: 100">
                     {% include "svn/login/register.html"%}
                  </div>
                  {% endif %}
                  {% if showrepo %}
                  {% include "svn/repo.html" %}
                  {% else %}
                  {% include "svn/directory.html" %}
                  {% endif %}
               </div>
   		</div>
   		<div class="push" style="height: 50px;"></div>
   </div>

   <div class="footer" style="height: 20px; text-align: center;"><p style="color: #777; text-shadow: 0 1px 0 white; font-size:2px" href=""><a href="https://github.com/eternalcharlie/EbiFurai" rel="tooltip" title="EbiFurai is open-sourced." onmouseover="$('#copyright').tooltip('show')" id="copyright">Powered by EbiFurai</a></p></div>
   </body>
</html>

<div id="spinner" class="spinner" style="display:none;">
 <div class="progress progress-striped active">
  <div class="bar" style="width: 100%;">Loading...</div>
</div>
</div>

<style>
.spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  margin-left: -100px; /* half width of the spinner gif */
  margin-top: -40px; /* half height of the spinner gif */
  text-align:center;
  z-index:1234;
  overflow: auto;
  width: 200px; /* width of the spinner gif */
  height: 82px; /*hight of the spinner gif +2px to fix IE8 issue */
  opacity: .5;
}

</style>
<script>

$(document).ready(function(){
  $("#spinner").bind("ajaxSend", function() {
    $(this).show();
  }).bind("ajaxStop", function() {
    $(this).hide();
  }).bind("ajaxError", function() {
    $(this).hide();
  });

     });

</script>

<script>
    function showLoading(){
      $("#spinner").show()
    }
   $("#loginhandler").click(function () {
       $("#loginpanel").animate({
           width: "toggle",
           height: "toggle"
           }, 500)
   });
   {% if not user.is_authenticated %}
   $("#register_login").click(function () {
       $("#loginpanel").animate({
           width: "toggle",
           height: "toggle"
           }, 500),
       $("#registerpanel").animate({
           width: "toggle",
           height: "toggle"
           }, 500),
       document.getElementById('loginhandler').style.display = 'none';
   });
   $("#register_login_close").click(function () {
       $("#registerpanel").animate({
           width: "toggle",
           height: "toggle"
           }, 500),
       document.getElementById('loginhandler').style.display = 'block';
   });
   var id_email = new LiveValidation('id_email');
   id_email.add( Validate.Presence );
   id_email.add( Validate.Email );
   
   
   var id_email = new LiveValidation('id_username');
   id_email.add( Validate.Presence );
   id_email.add( Validate.Length, { minimum: 4 } );
   id_email.add( Validate.Length, { maximum: 20 } );
   
   var id_email = new LiveValidation('id_password');
   id_email.add( Validate.Presence );
   id_email.add( Validate.Length, { minimum: 4 } );
   id_email.add( Validate.Length, { maximum: 20 } );
   
   
   
   var id_email = new LiveValidation('id_confirm_password');
   id_email.add( Validate.Presence );
   id_email.add( Validate.Length, { minimum: 4 } );
   id_email.add( Validate.Length, { maximum: 20 } );
   id_email.add( Validate.Confirmation, { match: 'id_password' } );
   
   
   {% endif %}
</script>
